<%#
kind: finish
name: Alterator default finish
model: ProvisioningTemplate
oses:
- ALTLinux p6
- ALTLinux p7
-%>
#!/bin/sh

<%= snippet 'fix_hosts' %>

apt-get update >/dev/null 2>/dev/null
apt-get -y install puppet >/dev/null 2>/dev/null


cat > /etc/puppet/puppet.conf << EOF
<%= snippet 'puppet.conf' -%>
EOF

/usr/bin/puppet agent --config /etc/puppet/puppet.conf -o --tags no_such_tag --server <%= @host.puppetmaster %> --no-daemonize
<%= snippet 'built' %>
/sbin/chkconfig puppetd on

<%= snippet 'schedule_reboot' -%>

exit 0
